package animix.blue.server.log.mapper;

import animix.blue.server.common.bean.model.LogLogin;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;
import java.util.Map;

public interface LogLoginMapper {

    @Insert("insert into tb_log_login (user_id, username, logined, ip, location, terminal, platform) values" +
            "(#{userId}, #{username}, #{logined}, #{ip}, #{location}, #{terminal}, #{platform})")
    @SelectKey(statement = "select last_insert_id()", keyProperty = "id", before = false, resultType = long.class)
    public void insert(LogLogin logLogin);

    @SelectProvider(type = LogLoginProvider.class, method = "list")
    List<LogLogin> list(Map<String, Object> para);
}
